# Excel模块
import xlrd
from Common import public  # 假设这里包含了file_path的定义

class OpeartionExcel:
    def get_sheet(self, num):
        book = xlrd.open_workbook(public.file_path())
        sheet = book.sheet_by_index(num)
        return sheet

    def get_alldata(self):
        datas = []
        title = self.get_sheet(0).row_values(0)  # 获取表头
        for i in range(1, self.get_sheet(0).nrows):
            row_value = self.get_sheet(0).row_values(i)
            datas.append(dict(zip(title, row_value)))
        return datas

class ExcelVar:
    def get_value(self):
        data = OpeartionExcel().get_alldata()
        case_list = []
        for row in data:
            case_list.append([
                row.get('接口地址'),
                row.get('请求方式'),
                row.get('请求头'),
                row.get('请求参数'),
                row.get('预期结果'),
                row.get('状态码')
            ])
        return case_list  # 返回一个列表的列表

print(OpeartionExcel().get_alldata())